<?php
$cs = Yii::app()->getClientScript();
$baseUrl = Yii::app()->request->baseUrl;
$cs->registerCssFile($baseUrl . '/css/slide_view.css');
$cs->registerScriptFile($baseUrl . '/js/jquery/slides.min.jquery.js', CClientScript::POS_END);
?>
<div>
    <h2><?php if (isset($postDetail)) echo $postDetail->title ?></h2>
    <?php if (count($postImages) > 0): ?>
    <div id="_images">
        <div id="products_example">
            <div id="products">
                <div class="slides_container">
                    <?php foreach ($postImages as $postImage): ?>
                        <a href="javascript:void(0)"><img src="<?php echo $postImage->path; ?>" width="400" height="450" alt="#"/></a>              
                    <?php endforeach; ?>
                </div>
                <ul class="pagination">
                    <?php foreach ($postImages as $postImage): ?>
                        <li><a href="javascript:void(0)"><img src="<?php echo $postImage->path; ?>" width="60"  height="60" alt="#"/></a></li>
                    <?php endforeach; ?>
                </ul>
            </div>    
        </div>
    </div>
    <?php endif ?>
    <div id="_content">
        <?php if (isset($postDetail)) echo $postDetail->content; ?>
    </div>
</div>
<script type="text/javascript">
    jQuery(function(){
        jQuery('#products').slides({
            preload: true,
            preloadImage: 'css/img/loading.gif',
            effect: 'slide, fade',
            crossfade: true,
            slideSpeed: 350,
            fadeSpeed: 400,
            generateNextPrev: true,
            generatePagination: false
        });
    });
</script>